import { IsNotEmpty } from 'class-validator';

class BaseSavePageDto {
  @IsNotEmpty({ message: '页面名称不能为空' })
  label: string;

  @IsNotEmpty({ message: '路由不能为空' })
  path: string;

  icon?: string;
}

export class SavePageDto extends BaseSavePageDto {
  id?: number | null;
  schema?: string;
}

export class SavePageMDto extends BaseSavePageDto {
  id: number | null;
  @IsNotEmpty({ message: 'Schema 不能为空' })
  schema: string;
  createdBy: number;
}
